package com.woniuxy.test_exception;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 * description: Test02 <br>
 * date: 2022/2/2 5:12 下午 <br>
 * author: shesaifei <br>
 * version: 1.0 <br>
 */

/**
 * ⚠️ 子类异常在父类异常前面
 */
public class Test02 {
    public static void main(String[] args) throws IOException {
        FileReader reader = null;
        try {
//            reader = new FileReader(
//                    "/Users/shesaifei/IdeaProjects/NewIdeaSpringAll/TotalReview/TheFirstStage/gg.txt");
            reader = new FileReader(
                    "/Users/shesaifei/IdeaProjects/NewIdeaSpringAll/TotalReview/TheFirstStage/g1g.txt");
            System.out.println("1");
            char c1 = (char) reader.read();
            System.out.println(c1);
        } catch (FileNotFoundException e) {
            System.out.println("2");
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            System.out.println("3");
            if (reader == null) {
                reader.close();
            }
        }
    }
}
